package com.kamisama.utopia.controller;

import com.kamisama.utopia.dto.CommandDto;
import com.kamisama.utopia.service.CommandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CommandController {

    @Autowired
    private CommandService commandService;

    @PostMapping("command")
    public ResponseEntity<CommandDto> command(@RequestBody CommandDto commandDto){
        CommandDto res = commandService.execute(commandDto);
        return ResponseEntity.ok(res);
    }
}
